package com.sky.context;

public class BaseContext {
    //创建了了一个线程局部变量
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //存储
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    //取出
    public static Long getCurrentId() {
        return threadLocal.get();
    }

    //删除
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
